package com.irdstudio.efp.cus.api.common;

import java.util.Optional;

public enum YedCompanyTypeEnum {

        COMP_TYPE_01("1","政府单位"),
        COMP_TYPE_02("2","事业单位"),
        COMP_TYPE_03("3","国有企业"),
        COMP_TYPE_04("4","世界500强企业"),
        COMP_TYPE_05("5","中国500强企业"),
        COMP_TYPE_06("6","国内主板上市企业"),
        COMP_TYPE_07("7","金融企业"),
        COMP_TYPE_08("8","白名单内的企业或民营学校"),
        COMP_TYPE_09("9","禁止准入行业");

        private String type;
        private String desc;
        YedCompanyTypeEnum(String type, String desc) {
        this.type=type;
        this.desc=desc;
    }
        public String getType() {
        return type;
    }

        public void setType(String type) {
        this.type = type;
    }

        public String getDesc() {
        return desc;
    }

        public void setDesc(String desc) {
        this.desc = desc;
    }

        public static YedCompanyTypeEnum getEnum(String type) {
        for (YedCompanyTypeEnum setlType : values()) {
            if (setlType.getType().equals(type)) {
                return setlType;
            }
        }
        return null;
    }

    public static void main(String[] args) {
        System.out.println(Optional.ofNullable(YedCompanyTypeEnum.getEnum("10")).isPresent());
    }
}
